package io.sage.modules.outwarehouse.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import io.sage.common.utils.BatchNumber;
import io.sage.modules.outwarehouse.dao.BGoodsReceiveRecordMapper;
import io.sage.modules.outwarehouse.entity.BGoodsReceiveRecord;
import io.sage.modules.outwarehouse.service.BGoodsReceiveRecordService;

@Service("goodsReceiveRecordService")
public class BGoodsReceiveRecordServiceImpl implements BGoodsReceiveRecordService {
	
	@Autowired
	private BGoodsReceiveRecordMapper goodsReceiveRecordMapper;
	
	/**
	 * 添加员工申请工具记录
	 * @param record
	 * @param employeeId
	 * @return
	 */
	@Override
	public int insert(BGoodsReceiveRecord goodsReceiveRecord,Integer employeeId) {
		goodsReceiveRecord.setCreateTime(new Date());
		goodsReceiveRecord.setIsDel(0);
		goodsReceiveRecord.setUpdateTime(new Date());
		goodsReceiveRecord.setBatch(BatchNumber.createSerial("SQPC", 2));
		return goodsReceiveRecordMapper.insertSelective(goodsReceiveRecord);
	}

	@Override
	public List<BGoodsReceiveRecord> selectReceiveRecordList(Map<String, Object> params) {
		
		return goodsReceiveRecordMapper.selectReceiveRecordList(params);
	}

}
